package com.hashmaptest;

import java.util.Objects;

/**
 * @author yaochenglong
 * @version V1.0
 * @date 2020/11/2 17:53
 * @DESC
 */
public class User {

    private int id ;
    private String name;

    public User(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        if(((User) o).id == id){
            return true;
        }
        return false;
    }

    @Override
    public int hashCode() {
        return 1;
    }
}
